package chapter07

import scala.collection.immutable.Queue
import scala.collection.mutable

/**
 * 队列_Queue
 */
object Test19_Queue {
  def main(args: Array[String]): Unit = {
    val queue: mutable.Queue[String] = new mutable.Queue[String]()

    //1、创建一个可变队列
    queue.enqueue("a", "b", "c")
    println(queue)
    println(queue.dequeue())

    println(queue)
    println(queue.dequeue())

    println(queue)
    println(queue.dequeue())


    println("===========================")
    //不可变队列
    val queue12: Queue[String] = Queue("a", "b", "c")
    val queue13 = queue12.enqueue("d")
    println(queue12)
    println(queue13)


  }
}
